//
//  BLMyMeetController.m
//  Byelone
//
//  Created by 乔小乔 on 2021/2/2.
//

#import "BLMyMeetController.h"
#import "BLMy_Cell_Meet.h"
#import "BLMeetDetailController.h"
#import "BLDestineRoomVC.h"
static NSString *reuse_BLMy_Cell_Meet = @"Reuse_BLMy_Cell_Meet";
@interface BLMyMeetController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableViewList;
@property (nonatomic, strong) NSArray *arrayData;

@end

@implementation BLMyMeetController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"我的约会";
    self.arrayData = [NSMutableArray new];
    self.view.backgroundColor = [UIColor chColorWithHexString:@"#F7F7F7"];
    [self.tableViewList reloadData];
}

- (void)loadData{
    
}
- (void)refreshData{
    [self loadData];
}
#pragma mark - delegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
//    return self.arrayData.count;
    return 10;;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
//    NSString *title = self.arrayData[indexPath.row];
    
    
    BLMy_Cell_Meet *cell = [tableView dequeueReusableCellWithIdentifier:reuse_BLMy_Cell_Meet forIndexPath:indexPath];
    BLWS(weakSelf)
    cell.myBlock = ^{
        BLDestineRoomVC *vc = [[BLDestineRoomVC alloc]init];
        [weakSelf.navigationController pushViewController:vc animated:YES];
    };
    [cell reloadWithData:nil];
    
    return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return UITableViewAutomaticDimension;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    BLMeetDetailController *vc = [[BLMeetDetailController alloc]init];
    [self.navigationController pushViewController:vc animated:YES];
}

#pragma mark - set&get
- (UITableView *)tableViewList{
    if (!_tableViewList) {
        _tableViewList = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, BL_WINDOW_WIDTH, BL_CONTENT_HEIGHT)];
        [self.view addSubview:_tableViewList];
        _tableViewList.backgroundColor = [UIColor clearColor];
        _tableViewList.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableViewList.delegate = self;
        _tableViewList.dataSource = self;
        if (@available(iOS 11.0, *)) {
            _tableViewList.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
        }else{
            self.automaticallyAdjustsScrollViewInsets = NO;
        }
        [_tableViewList registerNib:[UINib nibWithNibName:@"BLMy_Cell_Meet" bundle:nil] forCellReuseIdentifier:reuse_BLMy_Cell_Meet];
        _tableViewList.tableFooterView = [UIView new];
        _tableViewList.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(refreshData)];
    }
    return _tableViewList;
}

@end
